using MicroMsg.Storage;
using System;
namespace MicroMsg.UI.Util
{
	public class ForwardMsgHelper
	{
		private static ForwardMsg sForwardMsg;
		public static void ToForwardMsg(object objContent, ForwardKind kind, object args = null)
		{
			ForwardMsgHelper.sForwardMsg = new ForwardMsg(objContent, kind, args);
			ToolFunction.GotoPageForUserControl("/Source/UI/Chat/forward/ForwardPage.xaml", null, false);
		}
		public static ForwardMsg GetForwardMsg()
		{
			return ForwardMsgHelper.sForwardMsg;
		}
		public static bool HasMsgToForward()
		{
			return ForwardMsgHelper.sForwardMsg != null;
		}
		public static string GetOriginMsgTalker()
		{
			if (ForwardMsgHelper.sForwardMsg == null)
			{
				return "";
			}
			if (ForwardMsgHelper.sForwardMsg.mKind == ForwardKind.Kind_NormalMsg)
			{
				ChatMsg chatMsg = ForwardMsgHelper.sForwardMsg.mObjContent as ChatMsg;
				if (chatMsg != null)
				{
					return chatMsg.strTalker;
				}
			}
			else
			{
				if (ForwardMsgHelper.sForwardMsg.mKind == ForwardKind.Kind_ShareCard)
				{
					Contact contact = ForwardMsgHelper.sForwardMsg.mObjContent as Contact;
					if (contact != null)
					{
						return contact.strUsrName;
					}
				}
			}
			return "";
		}
		public static ForwardKind GetForwardKind()
		{
			if (ForwardMsgHelper.sForwardMsg == null)
			{
				return ForwardKind.Kind_None;
			}
			return ForwardMsgHelper.sForwardMsg.mKind;
		}
	}
}
